package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.CompanyDaoImpl;
import com.asset.salesforce.domain.Company;
import com.asset.salesforce.domain.Employee;

@Service
@Transactional(readOnly=true)
public class CompanyService {
	@Autowired
	CompanyDaoImpl companyDaoImpl;
	
	@Transactional(readOnly=false)
	public void addCompany(Company company) {
		companyDaoImpl.addCompany(company);
	}

	@Transactional(readOnly=false)
	public void deleteCompany(Integer id) {
		companyDaoImpl.deleteCompany(id);
	}
	
	@Transactional(readOnly=false)
	public Company getCompanyByName(String companyName) {
		return companyDaoImpl.getCompanyByName(companyName);
	}
	
	@Transactional(readOnly=false)
	public  List<Employee> getActivatedEmployeesByCompanyName(String companyName){
		return companyDaoImpl.getActivatedEmployeesByCompanyName(companyName);
	}
	
}
